<template>
  <div>
    <Search id="searchBox" shape="round" @search="onSearch()" v-model="searchVal" placeholder="请输入搜索关键词"></Search>
    <div v-for="item in msgData" :key="item.id">
      <BriefMsg :msg="item"></BriefMsg>
      <Divider style="margin: 0"/>
    </div>
  </div>
</template>

<script>
import BriefMsg from '../../components/BriefMsg'
import {Search, Divider} from 'vant'

export default {
  name: 'Message',
  components: {BriefMsg, Search, Divider},
  data () {
    return {
      msgData: [],
      searchVal: ''
    }
  },
  created () {
    this.msgData = [
      {
        id: 1,
        head: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=801475073,2329603026&fm=26&gp=0.jpg',
        name: '死神专卖店',
        content: '[亲，请您核对订单信息]',
        date: '1613194653359'
      },
      {
        id: 2,
        head: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201808%2F23%2F20180823185723_voqky.jpg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1615544654&t=664088a8a8f03909cc2a2576dc86ce0c',
        name: '火影专卖店',
        content: '亲，您很久没光顾小店了，快来进店看看(┬＿┬)',
        date: '1613194653359'
      },
      {
        id: 3,
        head: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2762516417,1589137703&fm=26&gp=0.jpg',
        name: '巨人专卖店',
        content: '您的订单已签收',
        date: '1613194653359'
      }
    ]
  },
  methods: {
    onSearch () {
      console.log('doSearch')
    }
  }
}
</script>

<style scoped>

</style>
